/**
 * 
 */
package de.fsujena.chat_pi.message;

/**
 * Representation of a file message. It contains informations for sending a file.
 * 
 * @author Erik Hebestreit
 * @see Message
 */
public class FileMessage extends Message {
	/**
	 * 
	 */
	private static final long serialVersionUID = 778594858348770906L;
	private String filename;
	private String localpath;
	private long filesize;

	/**
	 * Constructor.
	 */
	public FileMessage() {}

	/**
	 * Constructor.
	 * 
	 * @param filename name of the file to be sent, including file extension
	 */
	public FileMessage(String filename) {
		this.setFilename(filename);
	}
	
	/** 
	 * Constructor.
	 * 
	 * @param filename name of the file to be sent, including file extension
	 * @param localpath relative or absolute path to the file
	 */
	public FileMessage(String filename, String localpath) {
		this.setFilename(filename);
		this.setLocalpath(localpath);
	}

	/**
	 * Constructor.
	 * 
	 * @param filename name of the file to be sent, including file extension
	 * @param filesize size of the file in bytes
	 */
	public FileMessage(String filename, long filesize) {
		this.setFilename(filename);
		this.setFilesize(filesize);
	}

	/**
	 * Constructor.
	 * 
	 * @param filename name of the file to be sent, including file extension
	 * @param localpath relative or absolute path to the file
	 * @param filesize size of the file in bytes
	 */
	public FileMessage(String filename, String localpath, long filesize) {
		this.setFilename(filename);
		this.setLocalpath(localpath);
		this.setFilesize(filesize);
	}

	/**
	 * @return name of the file to be sent, including file extension
	 */
	public String getFilename() {
		return filename;
	}

	/**
	 * @param filename name of the file to be sent, including file extension
	 */
	public void setFilename(String filename) {
		this.filename = filename;
	}

	/**
	 * @return relative or absolute path to the file
	 */
	public String getLocalpath() {
		return localpath;
	}

	/**
	 * @param localpath relative or absolute path to the file
	 */
	public void setLocalpath(String localpath) {
		this.localpath = localpath;
	}

	/**
	 * @return size of the file in bytes
	 */
	public long getFilesize() {
		return filesize;
	}

	/**
	 * @param filesize size of the file in bytes
	 */
	public void setFilesize(long filesize) {
		this.filesize = filesize;
	}

}
